#ifndef __SNZ_APPLICATIONMANAGER_H__
#define __SNZ_APPLICATIONMANAGER_H__

#include "Ogre.h"
#include "OgreConfigFile.h"

#include "SnzFrameListener.h"
#include "ExampleFrameListener.h"


using namespace Ogre;

class SnzApplicationManager : public Ogre::Singleton<SnzApplicationManager>
{
protected:
    Root					*mRoot;						///< Entry point into Ogre  
	ExampleFrameListener	*mFrameListener;			///< Frame & object animator
    Camera					*mCamera;					///< Current camera
    SceneManager			*mSceneMgr;					///< Current scene manager
	RenderWindow			*mWindow;					///< Current render window

	String					mResourcePath;				///< Current Resource Path

    //Ogre::RaySceneQuery *mRaySceneQuery;
	//InputHandler        *mInputHandler;   ///< Called by above lib
	//InputManager        *mInputManager;   ///< Manages input library


    //CEGUI::System       *mGUISystem;
    //CEGUI::OgreCEGUIRenderer *mGUIRenderer;

    //ObjectMap           mObjectList;      ///< List of world objects

public:
    SnzApplicationManager();
    virtual ~SnzApplicationManager();

    static SnzApplicationManager&	getSingleton();
    static SnzApplicationManager*	getSingletonPtr();
        
	//Getters
    ExampleFrameListener*			getFrameListener(); 
    Camera*							getCamera();
    SceneManager*					getSceneManager();
	RenderWindow*					getRenderWindow();
    
	//virtual bool frameStarted(const Ogre::FrameEvent &evt);
    //virtual bool frameEnded(const Ogre::FrameEvent &evt);

    //Ogre::RaySceneQuery*        getRaySceneQuery();
    //ObjectMap&                  getObjectList(); 
	//InputManager*               getInputManager();
    //InputHandler*               getInputHandler();
    
	void start();			//Starting Function

protected:
    bool init();
	void setupResources();
	bool configure();
	void chooseSceneManager();
	void createCamera();
	void createViewports();
	void loadResources();
	void createScene();	
	void createFrameListener();
	

	void destroyScene();
	
    /// Override this function to setup the framework.  You'll need to 'new'
    /// an Input handler.  ~SnzApplicationManager will delete it.  See
    /// _defaultInputManager();
    //virtual void _initInput()=0;    
    //virtual void _defaultInputManager();
    //virtual void _createResourceListener();
    //virtual void _loadResources();


};  // class SnzApplicationManager

#endif